public class SampleBuffer {

  public static void main(String[] args) {  

    Queue buffer = new Buffer(5);
    Consumer c1 = new Consumer(buffer);
    Consumer c2 = new Consumer(buffer);
    Producer p1 = new Producer(buffer,10);
    Producer p2 = new Producer(buffer,10);
    p1.start();
    p2.start();

    c1.start();
    c2.start();
    try {
      p1.join();
      p2.join();
      c1.join();
      c2.join();
    } catch (InterruptedException e) {
    	System.out.println(e);
    }
    System.out.println("Koniec programu!!!");
  }
}